package com.unknowpupil.cloud.consumer.profile.feign.callback;

import com.unknowpupil.ccommon.utils.JsonUtils;
import com.unknowpupil.cloud.common.dto.ResponseResult;
import com.unknowpupil.cloud.consumer.profile.dto.UnAccountDto;
import com.unknowpupil.cloud.consumer.profile.dto.params.IconParam;
import com.unknowpupil.cloud.consumer.profile.dto.params.PasswordParam;
import com.unknowpupil.cloud.consumer.profile.dto.params.ProfileParam;
import com.unknowpupil.cloud.consumer.profile.feign.ProfileFeign;
import org.springframework.stereotype.Component;

/**
 * 个人信息熔断
 * @Classname: ProfileFeignCallBack
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2020/1/5 5:19
 * @Description:
 * @Version: 1.0
 */
@Component
public class ProfileFeignCallBack implements ProfileFeign {
    private static final String BACKING_MESSATE = "您的网络有问题，请检查";
    @Override
    public String info(String username) {
        UnAccountDto unAccountDto = new UnAccountDto();
        unAccountDto.setEmail("unknowpupil.163.com");
        try {
          return   JsonUtils.obj2json(new ResponseResult<UnAccountDto>(ResponseResult.CodeStatus.BREAKING,BACKING_MESSATE,unAccountDto));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public String update(ProfileParam profileParam) {
        return null;
    }

    @Override
    public String modifyPassword(PasswordParam passwordParam) {
        return null;
    }

    @Override
    public String modifyIcon(IconParam iconParam) {
        return null;
    }
}
